/**
 * @ClassName Code02_RightMostOne
 * @Description: TODO
 * @Author: JCC
 * @CreateTime: 2023/12/4 21:37
 */
public class Code02_RightMostOne {

    /**
     * ~num + 1  ==  -num
     * num & (-num) 是最右的数
     * @param num
     * @return
     */
    public static int rightMostOne(int num) {
        return num & (-num);
    }

    public static void main(String[] args) {
        int rightMostOne = rightMostOne(6);
        System.out.println(rightMostOne);
    }
}
